home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 65.zip
/
BS1 part 65
/
Math Visin v2.1 disk 1.adf
/
Arexx.WB
/
SayCHRS
< prev
next >
Wrap
Text File
|
1992-02-12
|
2KB
|
68 lines
/* sayCHRS show the CHRS hunk from a MathVision project 15-May-90
Utility for viewing the CHRS (formula) hunks in IFF ILBM files as
stored by MathVision.
----------------------------------------------------------------------- */
PARSE ARG filename /* what filename? */
if (length(Filename)<2) THEN
DO
SAY "This utility displays the formulas from MathVision projects."
SAY ""
SAY "From Workbench:"
SAY " 1. Click once on SayCHRS,"
SAY " 2. Hold down <SHIFT>,"
SAY " 3. And double-click on the desired picture."
SAY ""
SAY "From CLI:"
SAY " RX SAYCHRS filename"
SAY ""
OPTIONS PROMPT "Press <RETURN> to Exit"
pull ans
EXIT
END
IF( OPEN( fh, filename, 'Read')==0) THEN
DO
OPTIONS PROMPT "Cannot open file "filename". Press <RETURN>"
pull answer
EXIT
END
Seeker = 0
IsForm = READCH( fh, 4); Seeker = Seeker+4 /* is right file? */
if (IsForm~='FORM') THEN EXIT
formsize = c2d(READCH( fh, 4)); Seeker = Seeker+4
IsILBM = READCH( fh, 4 ); Seeker = Seeker+4
if (IsILBM~='ILBM') THEN EXIT
DO WHILE ( ~EOF(fh) & (Seeker < Formsize) )
PropertyType = READCH( fh, 4 ) ; Seeker = Seeker+4
PropertyLength = c2d(READCH( fh, 4 )); Seeker = Seeker+4
if (PropertyLength//2 ~= 0) THEN PropertyLength = PropertyLength+1
IF (PropertyType~='CHRS') THEN /* skip unknowns */
DO
Seeker = Seeker + PropertyLength
ok = Seek( fh, Seeker, 'B' ) /* Seek on 'Current' not work */
END
ELSE
DO
hunk = READCH( fh, PropertyLength ) /* display CHRS hunk */
i = 1; j = INDEX( hunk, d2c(10) )
Do while( j ~= 0)
say substr( hunk, i, j-i )
i = j+1
j = INDEX(hunk, d2c(10), i )
END
SAY ""
OPTIONS PROMPT "Press <RETURN> to exit."
PULL answer
EXIT
END
END
OPTIONS PROMPT "No CHRS hunk found. Press <RETURN>"
pull ans
EXIT